'use strict';

const path = require('path');
const root = path.resolve(__dirname, '..');
const pkg = require(path.join(root, 'package.json'));
const base = [path.join(root, 'index.html'),
              path.join(root, 'dist', '**', '*.*')];
const dest = path.join(root, 'release');

/**
 * Compress project
 *
 * @method zip
 */
function zip(gulp, plugins) {
  return () => gulp.src(base, { base: '.' })
    .pipe(plugins.zip(pkg.name.toString()))
    .pipe(gulp.dest(dest));
}
module.exports = zip;
